package org.gts.webtools;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.ThreadLocalRandom;

public class BatchNoUtil {

    private static final ThreadLocalRandom random = ThreadLocalRandom.current();

    private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyMMddHHmmssSSS");

    private static final int origin = 1000;
    private static final int bound = 10000;

    /**
     * yyMMddHHmmssSSS + 三位随机数
     *
     * @return
     */
    public static String get() {
        return LocalDateTime.now().format(FORMATTER) + random.nextInt(origin, bound);
    }
}